package com.qrcode.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.qrcode.entity.User;
import com.qrcode.service.UserService;

@Controller
public class UserController {
	
	@Autowired
	public UserService userService;
	
	@RequestMapping("/index")
	public String userIndex(HttpServletRequest request,HttpServletResponse response){
		User user = new User();
		user.setName("cjm");
		userService.insertUser(user);
		return "index/index";
	}
	
	@RequestMapping("/getUser")
	public String getUser(){
		User user = userService.getUserById("402881ec426598dc01426599145c0001");
		System.out.println(user.getName());
		return null;
	}
}
